import ajax from '@/libs/ajax'

const API_USERINFO = () => ajax('/v1/userInfo/getCurrentUserInfo', 'post')
const API_UPDATE_USERINFO = (data) => ajax('/v1/userInfo/updateUserInfo', 'post', data)
const API_UPLOAD_AVATAR = (img) => ajax('/v1/userInfo/uploadHeadImg', 'post', { headImg: img })

/* 用户培训 */
const API_USER_TRAIN = (data) => ajax('/v1/orderInfo/getBookFineTrain', 'post', data)

/* 我的预定 */
const API_USER_ORDER = (data) => ajax('/v1/orderInfo/getBookOrder', 'post', data)
const API_CHANGE_PHONE_MSG = (phone) => ajax('/v1/userInfo/sendUpdatePhoneMsg', 'post', { newPhone: phone })
const API_CHANGE_PHONE = (data) => ajax('/v1/userInfo/updatePhone', 'post', data)

export {
  API_USERINFO,
  API_UPDATE_USERINFO,
  API_UPLOAD_AVATAR,
  API_USER_ORDER,
  API_USER_TRAIN,
  API_CHANGE_PHONE_MSG,
  API_CHANGE_PHONE
}
